package pt.iscte.pcd.example.threads;
import java.util.Random;

public class MyThread extends Thread {

	private static final int MAX_CICLES = 10;
	private String name;
	private int MAX_SLEEP = 2000;

	public MyThread(int i) {
		name = "Thread" + i;
	}

	public void run() {
		Random r = new Random();
//		try {
//			for (int i = 0; i != MAX_CICLES; i++) {
			while (true) {
				System.out.println(name);
//				int t = r.nextInt(MAX_SLEEP);
//				System.out.println(name + " will sleep for " + t + " milisecs");
//				sleep(t);
//			}
//		} catch (InterruptedException e) {
//			// TODO Auto-generated catch block
//	//		e.printStackTrace();
		}
	}
}
